package com.lkd.controller;


import com.lkd.entity.Task;
import com.lkd.service.TaskService;
import com.lkd.vo.Result;
import com.lkd.vo.TaskVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 工单表 前端控制器
 * </p>
 *
 * @author 聂德祥
 * @since 2024-08-20
 */
@RestController
public class TaskController {
    @Autowired
    private TaskService taskService;
    @GetMapping("/api/task-service/task/taskReportInfo/{start}/{end}")
    public Result getTaskCount(@PathVariable("start") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime start, @PathVariable("end") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime end){
        System.out.println("=================");
        System.out.println(start);
        System.out.println(end);
        System.out.println("lalala");
        List<TaskVo>  taskVos= taskService.getTaskCount(start,end);

        System.out.println(taskVos);
        System.out.println("=================");
        return Result.success(taskVos);
    }
}
